Roman M. Link
This is a simplified short form of the BOT2 tutorial for the pre-processing and analysis of wood anatomical microtome slides based on GIMP and ImageJ which is meant for in-class use.
A list of useful GIMP shortcuts can be found here: (https://www.gimpusers.com/gimp/hotkeys).
Note that the term CODE in this document is a placeholder that has to be replaced by the unique ID of sample you are working with! In the screenshots in this example, the CODE is CRI_3_010.
All ImageJ results tables can be saved either in ‘Comma Separated Value’ (.csv) or whitespace/tabstop separated format (generated when saving with a .xls extension, but actually just a plain text format). In either case, the output is optimized for US/UK locales, which means that points are used as a decimal separator. In order to process these files on German systems without compatibility issues, it is important to make sure that the system-wide decimal separator is correctly set before starting the analysis.
In German Windows 10, the option to change the decimal separator is well hidden:
Start Menu ➜ Windows-System ➜ Systemsteuerung ➜ Zeit und Region ➜ Region ➜ Formate ➜ Weitere Einstellungen ➜ Dezimaltrennzeichen
To avoid data compatibility problems, make sure the decimal separator is set to “.”. In this case, you will want the grouping symbol (Symbol für Zifferngruppierung) to be a comma instead of the point symbol used in Germany.
If you do not want to change your system settings, you can alternatively export everything in a .csv format and use Excel’s Daten ➜ Text in Spalten menu to manually set field delimitor and decimal separator.
Open original image CODE.jpg
Select the Polygon Lasso tool (GIMP shortcut: F) and cut out xylem and pith (double click to finish selection process)
Copy selection (Ctrl + C)
Paste selection to new file (Ctrl + Shift + V)
Close tab with original image (do not save changes!)
Zoom in to focus on the pith (+/- or Ctrl + mouse wheel), select the Polygon Lasso tool (F) and cut out the pith (Ctrl + X or Del)
Export the new picture (full xylem area with cut-out bark and pith) as CODE_GI_01.jpg (export as: Ctrl + Shift + E) using the maximal quality setting - the GI in the name means the file has been processed in GIMP.
Save the file CODE_GI_cropped_01.jpg (export as: Ctrl + Shift + E).
[optionally] adjust brightness and contrast using color curves (German: Farben ➜ Kurven, English: Colors ➜ Curves)
If your sample is surrounded by transparency (indicated by a checkerboard pattern) instead of a white background:
save the image in GIMP’s .xcf format as CODE_GI.xcf or CODE_GI_cropped.xcf. This file will be used later for the different post-processing steps necessary to improve the initial image classification.
decompose image into its RGB components (German: Farben ➜ Komponenten ➜ Zerlegen, English: Colors ➜ Components ➜ Decompose) - this creates a new image that separates the original image into its red, green and blue channel (if this step changes the shape of the wood section and suddenly cut-out areas reappear, you forgot to delete the alpha channel).
CODE_GI_cropped_02.jpg.CODE.jpg) with ImageJ (either by the File dialog or by dragging and dropping onto the ImageJ window).Set the scale to the appropriate value by going to the Analyze ➜ Set Scale menu.
In the corresponding dialog, set the Known Distance (the value above the scale bar), the Unit of length (normally µm; see scale bar) and - very important - mark the box Global to make sure that the scale is the same accross all opened documents.
Open the modified image CODE_GI_cropped_02.jpg with ImageJ (drag & drop onto ImageJ bar) - if the scale is correctly set, the dimensions of the picture in µm should be visible in the upper left corner (if the values is in pixels).
Transform the grayscale image into a threshold image
Save this image as CODE_GI_cropped_02_TH_01.jpg
.tiff formatCODE_GI_cropped_02_TH_01_Area.xls. The area of the analyzed wood portion can then be calculated by substracting the black area from the total area of the image.Use the Flood Fill tool to replace the surrounding black area with a solid white color.
Save the image without the black area as CODE_GI_cropped_02_TH_02.jpg
To prepare for automated vessel detection, open the Analyze ➜ Set Measurements dialog and select Area, Shape descriptors, Perimeter, Fit ellipse and Feret’s diameter
.jpg document, specifying the selected Area and Circularity values in the name (e.g. CODE_GI_cropped_02_TH_02_Outlines_300,0.3.jpg) using the File ➜ Save As ➜ Jpeg option in the main menu of ImageJ (not the newly opened Results window!). Make sure the right image window is selected when saving.Open the threshold file (CODE_GI_cropped_02_TH_02.jpg) and the outline file(CODE_GI_cropped_02_TH_02_Outlines_300,0.3.jpg) in GIMP (mark both files, right click and select Open with GIMP / Öffnen mit GIMP).
EDIT and make screenshots!!!!
copy on top of each other
cut out background
change mode to see changes
go back to threshold step if it looks bad
final slide
Your project folder should now look somewhat like this (note that often, you will have to try more than one setting for circularity and minimum vessels size, and you will have to do more than one edit, which all show up as additional files in the project folder - add new figure)